﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/static/include/topLess.jsp"%>
<table>
	<tbody>

		<tr>
			<th><img src="${ctx}/static/images/pages/cen/rig/ico_01.png"
				align="absmiddle">&nbsp;单位选择</th>
		</tr>
		<tr class="tab_grey">
			<td>
				<form name="searchForm" action="" method="post">
				<input type="hidden" name="p" value="1" />
					<span class="tab_text"> 单位名称： </span> <input id="unitName"
						type="text" name="unitName" value="${param['unitName']}" size="20"
						class="tab_textbut" /> <span class="tab_text">组织机构代码：</span> <input
						id="unitNo" type="text" name="unitNo" value="${param['unitNo']}"
						size="20" class="tab_textbut" /> <span class="tab_text">单位类型：</span>
					<select id="roleId" name="roleId">
						<option value="">请选择..</option>
						<c:forEach var="role" items="${roleList}">
							<option value="${role.id}">${role.roleName}</option>
						</c:forEach>
					</select> 
					<a class="tab_but" href="#"
						onclick="searchForm.action='${baseURL}/unit/find';searchForm.submit();return false;">查询</a>
				</form>
				<form name="uploadForm" target="upload"
					action="${baseURL}/unit/uploadFile" method="post"
					enctype="multipart/form-data">
					<a class="tab_but02" href="${baseURL}/unit/downloadTemple"
						onclick="${baseURL}/unit/downloadTemple">下载企业模板</a>
					<input type="file" name="uploadFile" id="upload" style="width:150px;"> <a
						class="tab_but02" href="#"
						onclick="uploadForm.submit();return false;">企业信息导入</a>${msg }
				</form>
				<script>
		$("#roleId").val("${param['roleId']}");
		$("#unitName").val("${param['unitName']}");
		$("#unitNo").val("${param['unitNo']}");
	
		</script> <iframe name="upload" width="0" height="0" frameborder="0"></iframe>
			</td>
		</tr>

	</tbody>
</table>



<br />
<c:if test="${empty obj.operationResult}">
	<b>没有符合条件的记录。</b>
</c:if>
<c:if test="${not empty obj.operationResult}">

	<table id="listTable">
	<tbody>
		<tr>
				<th width="30%">单位名称</th>
				<th width="25%">组织机构代码</th>
				<th width="15%">行政区划</th>
				<th width="15%">单位类型</th>
				<th>操作</th>
				
			
		</tr>
		<c:forEach var="oneRow" items="${obj.operationResult}">

			<tr>
				<td align="left" class="tab_td_rig">${oneRow.userUnit}</td>
				<td align="left" >${oneRow.userInstitutionCode}</td>
				<td align="left" >${oneRow.userAreaName}</td>
				<td align="left" >${oneRow.roleName}</td>
				<td align="left" ><a href="#"
					onclick="chooseUnit('${oneRow.id}','${oneRow.userUnit}','${oneRow.userUnitId}')"><img
						src="${baseURL}/static/images/tab/ico_01.png" width="16"
						height="16" border="0" align="absmiddle" />选择</a></td>
			</tr>
		</c:forEach>
		<tr class="tab_grey">
				<td colspan="7" align="center" valign="middle" class="tab_white">
				<div class="pagination"> 
					<%@ include file="../include/listpage2.jsp"%>
				</div>
				<div class="clear"></div>
				</td>
			</tr>	
		
		</tbody>
	</table>
</c:if>
<script>
//查找直属单位
function chooseUnit(id,name,unitId){
	$.getJSON("${baseURL}//report/userReport?uid="+id+"&typeId=${reportId}", function(data) {
		if(data.result=="NG"){
			alert("该用户不能填报此报表");
			return false;
		}
		else
		     closeWin({"userId":id,"unitName":name,"unitId":unitId});
 });
}
</script>
<%@ include file="/static/include/bottom.jsp"%>
